package com.sgu6.sgu6_machine.base;

import android.content.Context;
import android.graphics.Typeface;
import android.os.Bundle;

import android.view.WindowManager;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.sgu6.sgu6_machine.config.MachineConfig;

import butterknife.Unbinder;


public class BaseF extends Fragment {

    protected final String TAG = this.getClass().getSimpleName();
    protected Unbinder unbinder;
    public MachineConfig machineConfig = new MachineConfig();

    public void getScreenFocus() {
        getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
    }

    public void loseScreenFocus() {
        getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
    }

    public void updateConfig() {
        try {
            machineConfig.updateMachineConfig(requireContext());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
